package com.jsb.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jsb.mapper.SysRoleMapper;
import com.jsb.model.SysRole;
import com.jsb.model.SysRoleExample;

@Service
public class SysRoleService{
	
	@Resource
	private SysRoleMapper sysRoleMapper;
	
	public void addSysRole(SysRole sysRole) {
		sysRoleMapper.insertSelective(sysRole);
	}
	
	public void delSysRoleById(String id) {
		sysRoleMapper.deleteByPrimaryKey(id);
	}
	
	public void updateSysRole(SysRole sysRole) {
		sysRoleMapper.updateByPrimaryKeySelective(sysRole);
	}
	
	public void updateSysRoleByExample(SysRole sysRole,SysRoleExample sysRoleExample){
	    sysRoleMapper.updateByExampleSelective(sysRole,sysRoleExample);
	}
	
	public SysRole getSysRoleById(String id) {
		return sysRoleMapper.selectByPrimaryKey(id);
	}
	
	public List<SysRole> getPageSysRole(SysRoleExample sysRoleExample) {
		return sysRoleMapper.selectPage(sysRoleExample);
	}
	
	public int countSysRole(SysRoleExample sysRoleExample) {
		return sysRoleMapper.countByExample(sysRoleExample);
	}
	
	public List<SysRole> selectByExample(SysRoleExample example){
	    return sysRoleMapper.selectByExample(example);
	}
}
